import { useState } from "react";
import { View, Text } from "@tarojs/components";
import { useLoad } from "@tarojs/taro";
import "./index.less";

export default function Index() {
  const [showActionsheet] = useState(true);

  useLoad(() => {
    console.log("Page loaded.");
  });

  const btnClick = () => {
    console.log("-btnClick-", btnClick);
  };

  return (
    <View className='index'>
      <Text>Hello world!</Text>
      <mp-actionSheet
        bindactiontap={btnClick}
        show={showActionsheet}
        actions={[
          { text: "示例菜单", value: 1 },
          { text: "示例菜单", value: 2 },
          { text: "负向菜单", type: "warn", value: 3 },
        ]}
        title='这是一个标题，可以为一行或者两行。'
      ></mp-actionSheet>
    </View>
  );
}
